package com.itheima.search.controller;

import com.itheima.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author wang
 * @description
 * @date 2021/7/31 10:31
 */
@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private SearchService searchService;
    @PostMapping
    public Map search(@RequestBody Map searchMap) throws Exception {
        Map resultMap = searchService.search(searchMap);
        return resultMap;
    }
}
